//整理成绩
//导入fs模块
const fs =require("fs")
//2调用fs.readFile()读取文件内容
fs.readFile("./files/1.txt","utf8",function(err,dataStr){
    console.log("读取文件成功"+dataStr);
        let oldArr = dataStr.split(" ")
        console.log(oldArr);
        const arrNew = []
        oldArr.forEach((item)=>{
            arrNew.push(item.replace("=",":"))
        })
        console.log(arrNew);
       const newStr = arrNew.join("\r\n")
       console.log(newStr);
       //调用写入文件
       fs.writeFile("./files/02.txt",newStr, ()=>{})
})